<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<!DOCTYPE html>
<html style="height:100%;">
<head>
<link rel="icon" href="<%=basePath%>resources/images/img/icon.png" type="image/x-icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="<%=basePath%>resources/js/common/plugin/jquery/jquery.min.js"></script>
<!-- <title>贵州省重点营运车辆联网联控平台</title> -->
<title></title>
<link rel="stylesheet" href="resources/css/login.css">
<script type="text/javascript">
var appCtx="<%=basePath%>";
</script>
</head>  
<body class="login">
    <div class="main">
        <div class="content">
            <div class="banner">
            	<img src="" alt="">
            </div>
            <div class="signIn">
                <form class="clearfix" action="doLogin.html" method="post">

                <div class="user fl inputDiv">
                    <input class="input" id="user" type="text" name="login_name" value="请输入用户名" placeholder="请输入用户名" autocomplete="off">
                    <div id="forUserName"></div>
                </div>
                <div class="password fl inputDiv pr">
                    <input class="input" id="password" type="password" name="login_pwd" value="" placeholder="请输入密码" autocomplete="off"><span class='mima pa'></span>
                    <div id="forPassword"></div>
                </div>
                <button class="btn fl" type="submit">登录</button>
                </form>
            </div>
        </div>
    </div>
    <script>
    $(document).ready(function() {
    	$.ajax({
        	url : appCtx + 'gis/monitor/queryDeploymentAreaInfo.jhtml',
        	dataType : 'json',
        	success : function(data){
        	    var cityMapCenter=[]
        	    window.document.title=data.platName;
        	    localStorage.setItem('platName',data.platName);
        	    localStorage.setItem('areaCode',data.code);
        	    localStorage.setItem('cityMapCenter',[data.longitude,data.latitude]);
        		switch (data.code){
				case "520000":
					$('.banner img').attr('src',appCtx+'resources/images/login/bj_guizhou.png');
					break;
				case "450100":
					$('.banner img').attr('src',appCtx+'resources/images/login/bj_nanning.png');
					break;
				case "131000":
					$('.banner img').attr('src',appCtx+'resources/images/login/bj_langfang.png');
					break;
				case "0":
					$('.banner img').attr('src',appCtx+'resources/images/login/bj_yicheng.png');
					break;
				}

        	}
        });
        //登录窗口账户密码input点击
        $('#user').focus(function() {
            var val = $('#user').val();
            if (val == '请输入用户名') {
                $('#user').val('').css('color','#666');
            }
        });
        $('#password').focus(function() {
            var val = $('#login_pwd').val();
            if (val == '请输入密码') {
                $('#password').val('');
            }
        });
        //登录窗口账户密码input失去焦点
        $('#user').blur(function() {
            var val = $('#user').val();
            if (val == '') {
                $('#user').val('请输入用户名').css('color','#ccc');
            }
        });
        $('#password').blur(function() {
            var val = $('#password').val();
            if (val == '') {
                $('#password').attr('placeholder','请输入密码');
            }
        });
        
        var msg = "<%=request.getAttribute("msg")%>";
        var login_name ="<%=request.getAttribute("login_name")%>";
        if (msg != 'null'&& login_name != 'null'){
                $("#user").val(login_name);
                $("#forPassword ").text(msg);
        };
        if (msg != 'null'&& login_name == 'null'){
            $("#forUserName").text(msg);
        };
         //判断在IE8 ie9下才生效的密码
        var b_version=navigator.appVersion 
        var version=b_version.split(";"); 
        var trim_Version=version[1].replace(/[ ]/g,""); 
        if( trim_Version=="MSIE8.0" || trim_Version=="MSIE9.0") {
         $('.mima').html('请输入密码').css('display','block');
         
         $(".mima").click(function() {
             $('#password').focus();
         });
         $("#password").keydown(function() {
             $(".mima").css('display', 'none');
         });
         $("#password").blur(function() {
             var val = $(this).val()
             if (val == '') {
                 $(".mima").css('display', 'block');
             }
         });
         if($("#password").val()!=''){
         	$(".mima").css('display', 'none');
         };
        }


    })
</script>

</body>
</html>
